package com.eascs.o2o.operateLog.server.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.o2o.common.vo.ModelResult;
import com.eascs.o2o.operateLog.dao.OperateLogDao;
import com.eascs.o2o.operateLog.server.OperateLogService;
import com.eascs.o2o.uc.entity.MemberOperateLogEntity;

@Service
public class OperateLogImpl implements OperateLogService{
	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private OperateLogDao operateLogDao;


	@Override
	public ModelResult<MemberOperateLogEntity> insertMemberOperateLog(MemberOperateLogEntity entity) {
		ModelResult<MemberOperateLogEntity> modelResult=new ModelResult<>();
		try {
			MemberOperateLogEntity model=operateLogDao.insertMemberOperateLog(entity);
			modelResult.withModel(model);
			return modelResult;
		} catch (Exception e) {
			logger.info("OperateLog.error.insertMemberOperateLog(),exception:{}", e.getMessage());
		}
		return modelResult.withError("OperateLog.error.insertMemberOperateLog()", "插入失败!");
	}

}
